<include file="public:no_bs_header" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadstyle/css/webuploader.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadstyle/css/diyUpload.css">
<script type="text/javascript" src="__STATIC__/admin/uploadstyle/js/webuploader.html5only.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/uploadstyle/js/diyUpload.js"></script>
<!--添加文章-->
<form id="info_form" action="{:U('member/albumedit')}" method="post" enctype="multipart/form-data">
    <div class="pad_lr_10" style="margin-top: 10px;">
        <div class="col_tab" id="col_tab">
            <ul class="J_tabs tab_but cu_li">
                <li href="#con1" class="current">学员风采</li>
                <!--<li href="#con2">{:L('article_seo')}</li>-->
            </ul>
            <div class="J_panes">
                <div id="con1" class="content_list pad_10">
                    <table width="100%" cellspacing="0" class="table_form">

                        <tr>
                            <th>风采标题 :</th>
                            <td>
                                <input type="text" name="title" id="title" value="{$info.title}" class="input-text" size="50">
                            </td>
                        </tr>
                        <tr>
                            <th>排序 :</th>
                            <td>
                                <input type="text" name="ordid" id="ordid" value="{$info.ordid}" class="input-text" size="8">
                            </td>
                        </tr>
                        <tr>
                            <th>{:L('article_img')} :</th>
                            <td>
                                <div id="box">
                                    <div id="container" >
                                        <if condition="$info.img neq ''">
                                            <div style="width: 180px;" class="parentFileBox">
                                                <ul class="fileBoxUl">
                                                    <li id="fileBox_" class="diyUploadHover">
                                                        <div class="viewThumb">
                                                            <img src="__ROOT__/upload/{$info.img}"></div>
                                                        <div class="diyCancel"></div>
                                                        <div class="diySuccess"></div>
                                                        <div class="diyFileName">{$info.img}</div>
                                                    </li>
                                                </ul>
                                            </div>
                                        </if>
                                    </div>
                                    <div id="test" ></div>
                                </div>
                                <input type="hidden" name="img" id="img" class="input-text" value="{$info.img}" /></td>
                        </tr>
                        <tr>
                            <th>详细内容 :</th>
                            <td><textarea name="content" id="content" style="width:68%;height:400px;visibility:hidden;resize:none;">{$info.content}</textarea></td>
                        </tr>
                    </table>
                </div>
            </div>
            <input type="hidden" name="id" value='{$info.id}'>
            <div class="mt10"><input type="button" value="{:L('submit')}" id="dosubmit" name="dosubmit" class="obtn obtn_submit" style="margin:0 0 10px 100px;"><br /><br /><br /></div>
        </div>
    </div>
</form>
<include file="public:footer" />
<script charset="utf-8" src="__STATIC__/editor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="__STATIC__/editor/lang/zh-CN.js"></script>

<script>
    $(function() {
        //初始化编辑器
        KindEditor.ready(function(K) {
            window.editor = K.create('#content',{
                width: '730px',
                height: '360px',
                afterBlur: function(){this.sync();}
            });
        });

        var cate_path = "{$article.cate_path}"
        var cate_source = $('#json_cate_list').val();
        cate_select_default(cate_source, cate_path)
        $('#dosubmit').click(function(){
            var title   = $('#title').val();
            if(!$.trim(title))
            {
                layer.msg('请输入标题');
                return false;
            }
            $('#info_form').submit();
        });


        $('#test').diyUpload({
            fileNumLimit:1,
            container: 'container', //图片预览容器
            url:"{:U('upload/index', array('cate' => 'album'))}",
            success:function( data ) {
                //console.info(data.data.file.name);
                var img_path = '/album/'+ data.data.file.savepath + data.data.file.savename
                $('#img').val(img_path)
            },
            error:function( err ) {
                //console.info( err );
            }

        });
        $('.diyCancel').click(function(){
            $(this).parents('li').remove();
            $('#img').val('')
        })
    });

</script>
</body>
</html>